package com.qingding.view;

import android.graphics.drawable.Drawable;
import android.support.v7.app.AppCompatActivity;
import android.widget.RadioButton;

/**
 * Created by Administrator on 2017-12-24.
 */

public class RadioButtonTools {
    public static void changeSize(int[] radio_buttons, int[] drawables, AppCompatActivity activity,int radio_button) {
       if(radio_button!=0){

            for (int i=0;i<radio_buttons.length;i++){
                RadioButton radioButton= (RadioButton) activity.findViewById(radio_buttons[i]);
                Drawable thing_sign = activity.getResources().getDrawable(drawables[i]);
                thing_sign.setBounds(0, 0, 50, 50);
                Drawable radio_button_sign=activity.getResources().getDrawable(radio_button);
                radio_button_sign.setBounds(0,0,50,50);
                radioButton.setCompoundDrawables(thing_sign, null, radio_button_sign, null);
            }
        }else{
            for (int i=0;i<radio_buttons.length;i++){
                RadioButton radioButton= (RadioButton) activity.findViewById(radio_buttons[i]);
                Drawable thing_sign = activity.getResources().getDrawable(drawables[i]);
                thing_sign.setBounds(0, 0, 70, 70);
                radioButton.setCompoundDrawables(null, thing_sign, null, null);
            }
       }
    }
}
